package be.jaisy.ui.gwt.client.widget;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.Widget;

public class ActionsBar extends Composite {

		private final DockPanel bar = new DockPanel();
		
		public ActionsBar(boolean enableDefault) {
			initWidget(bar);
			bar.setStyleName("actionbar");
		}
		
		public void addAction(Widget widget){
			bar.add(widget);
			bar.setCellHorizontalAlignment(widget, DockPanel.ALIGN_LEFT);
		}

		public void removeAction(Widget widget){
			bar.remove(widget);
		}
		
		public void clear(){
			bar.clear();
		}
	}